/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.beans;

import edu.upn.sigemfi.can.bc.TransaccionInternaWebDelegate;
import edu.upn.sigemfi.can.be.TransaccionInternaWeb;
import java.util.List;

/**
 *
 * @author Orlando ( U )
 */
public class TransaccionInternaWebController {

    private TransaccionInternaWebDelegate delegado;
    private TransaccionInternaWeb transaccionInternaWeb;

    public TransaccionInternaWebController(){
        delegado = new TransaccionInternaWebDelegate();
    }

    public List<TransaccionInternaWeb> getTransaccionesInternasWebs() {
        try {
            return delegado.listar();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public String nuevo() {
        transaccionInternaWeb = new TransaccionInternaWeb();
        return "nuevo";
    }

    public String editar() {
        return "editartransaccioninternaweb";
    }

    public String registrar() {
        try {
            delegado.crear(transaccionInternaWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String eliminar(){
        try {
            delegado.eliminar(transaccionInternaWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String actualizar() {
        try {
            delegado.editar(transaccionInternaWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public TransaccionInternaWeb getTransaccionInternaWeb() {
        return transaccionInternaWeb;
    }

    public void setTransaccionInternaWeb(TransaccionInternaWeb transaccionInternaWeb) {
        this.transaccionInternaWeb = transaccionInternaWeb;
    }


}
